﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace WCS.Infrastructure.EFCore;

/// <summary>
/// 商户表
/// </summary>
[Table("Merchant")]
[Index("MerchantCode", Name = "Merchant_MerchantCode_idx", IsUnique = true)]
public partial class Merchant
{
    /// <summary>
    /// 商户ID
    /// </summary>
    [Key]
    [StringLength(32)]
    public string Id { get; set; } = null!;

    /// <summary>
    /// 商户编号
    /// </summary>
    [StringLength(32)]
    public string MerchantCode { get; set; } = null!;

    /// <summary>
    /// 商户名称
    /// </summary>
    [StringLength(255)]
    public string Name { get; set; } = null!;

    /// <summary>
    /// 商户地址
    /// </summary>
    [StringLength(255)]
    public string? Address { get; set; }

    /// <summary>
    /// 商户详细地址
    /// </summary>
    [StringLength(512)]
    public string? DetailedAddress { get; set; }

    /// <summary>
    /// 联系人名称
    /// </summary>
    [StringLength(64)]
    public string? ContactPerson { get; set; }

    /// <summary>
    /// 联系电话
    /// </summary>
    [StringLength(11)]
    public string ContactPhone { get; set; } = null!;

    /// <summary>
    /// 商户类型
    /// </summary>
    public int MerchantType { get; set; }

    /// <summary>
    /// 结算周期
    /// </summary>
    public int SettlementCycle { get; set; }

    /// <summary>
    /// 扩展属性
    /// </summary>
    public string? ExtraProperties { get; set; }

    /// <summary>
    /// 并发标记
    /// </summary>
    [StringLength(40)]
    public string? ConcurrencyStamp { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime CreationTime { get; set; }

    /// <summary>
    /// 创建人ID
    /// </summary>
    [StringLength(32)]
    public string? CreatorId { get; set; }

    /// <summary>
    /// 最后修改时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime? LastModificationTime { get; set; }

    /// <summary>
    /// 最后修改者ID
    /// </summary>
    [StringLength(32)]
    public string? LastModifierId { get; set; }

    /// <summary>
    /// 是否删除
    /// </summary>
    public bool IsDeleted { get; set; }

    /// <summary>
    /// 删除者ID
    /// </summary>
    [StringLength(32)]
    public string? DeleterId { get; set; }

    /// <summary>
    /// 删除时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime? DeletionTime { get; set; }

    /// <summary>
    /// 启用状态
    /// </summary>
    public int EnableStatus { get; set; }

    /// <summary>
    /// 业务开通信息
    /// </summary>
    [Column(TypeName = "jsonb")]
    public string? Business { get; set; }

    /// <summary>
    /// 平台商户编号
    /// </summary>
    [StringLength(20)]
    public string? AcqSpId { get; set; }

    /// <summary>
    /// 商户编号
    /// </summary>
    [StringLength(20)]
    public string? AcqMerId { get; set; }

    /// <summary>
    /// 商户侧唯一标识
    /// </summary>
    [StringLength(50)]
    public string? MerId { get; set; }

    /// <summary>
    /// 审核结果通知地址
    /// </summary>
    [StringLength(200)]
    public string? BackUrl { get; set; }

    /// <summary>
    /// 商户详细信息
    /// </summary>
    [Column(TypeName = "jsonb")]
    public string? Paper { get; set; }

    /// <summary>
    /// 是否收单
    /// </summary>
    public int? AcceptOrder { get; set; }

    /// <summary>
    /// 业务启停回调地址
    /// </summary>
    [StringLength(200)]
    public string? BusinessBackUrl { get; set; }

    /// <summary>
    /// 版本号
    /// </summary>
    [StringLength(5)]
    public string? Version { get; set; }

    /// <summary>
    /// 商户名称
    /// </summary>
    [StringLength(100)]
    public string? MerchantName { get; set; }

    /// <summary>
    /// 账户状态（0：未开通，1：已开通，2：冻结；3：注销；4：止付；5：禁止入金）
    /// </summary>
    public int? AccountStatus { get; set; }

    /// <summary>
    /// 审核状态（1：待审核; 2：审核通过; 3：审核未通
    /// 过）
    /// </summary>
    public int? AuditStatus { get; set; }

    /// <summary>
    /// 审核说明
    /// </summary>
    [StringLength(255)]
    public string? AuditMsg { get; set; }

    /// <summary>
    /// 审核时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime? AuditTime { get; set; }

    /// <summary>
    /// 经纬度
    /// </summary>
    [StringLength(32)]
    public string? Location { get; set; }

    /// <summary>
    /// 支付平台ID
    /// </summary>
    [StringLength(32)]
    public string? PaymentPlatformId { get; set; }
}
